// dlg.txt

//MK Edit

//mark_quest_dest(zone,x,y,layer,quest);
//	code =
//		sf(,,2);
//		toggle_quest(19,10);
//		award_party_xp(MED_QUEST_XP);
//	break;

begintalkscript;

variables;

short this_town = 20;

begintalknode;
	tag = 1;
	condition = get_sdf(this_town,1) == 0;
	text1 = "You cross a bridge and enter Mistglen. It is, even by the standards of the Kranas, lovely. Light pools of mist form at your feet, and your steps kick up little clouds of fog. You hear no wildlife.";
	text2 = "Some clan has built a settlement here. You can see their tower, crops, and tools. However, nobody is outside, and the crops are slowly dying. Strange.";
	text3 = "As you explore, you start to detect an odor. A faint, unpleasant, sour smell. The more of it you inhale, the sicker you feel. The trees and bushes look healthy enough, but the air is toxic.";
	code =
		sf(this_town,1,1);
	break;
	
begintalknode;
	tag = 2;
	condition = get_sdf(this_town,2) == 0;
	text1 = "This was a natural tunnel that has been widened and reinforced by the clan above. Perhaps this was going to be a mine. Maybe they were going to ferment wine down here. There are lots of uses for a nice, big dungeon.";
	text2 = "Alas, the vile gases in the air are far stronger down there. You immediately start to choke, and your throat burns.";
	text3 = "As long as these gasses are in the air, the longer you are down here, the worse it will be.";
	code =
		sf(this_town,2,1);
	break;

begintalknode;
	tag = 3;
	condition = get_sdf(this_town,3) == 0 && gf(30,17) == 2;
	text1 = "You examine this stump closely. Maybe it has some of the sap you were asked to recover in the Tower of the Erudico.";
	text2 = "No such luck. The stump is old and completely dry.";
	code =
		sf(this_town,3,1);
	break;

begintalknode;
	tag = 4;
	condition = get_sdf(this_town,4) == 0 && gf(30,17) == 2;
	text1 = "You examine this stump closely. Maybe it has some of the sap you were asked to recover in the Tower of the Erudico.";
	text2 = "No such luck. The stump is old and completely dry.";
	code =
		sf(this_town,4,1);
	break;

begintalknode;
	tag = 5;
	condition = get_sdf(this_town,5) == 0;
	text1 = "In the dim light, you can see a battle happening to the east. There are two warriors there. They are in an utter panic, trying to run toward the exit behind you.";
	text2 = "Several rootlings have crawled out of the ground and blocked their escape route. They are hacking at the creatures, utterly lost in terror.";
	code =
		sf(this_town,5,1);
		set_attitude(2035,3);
		set_attitude(2036,3);
		set_attitude(30006,10);
	break;

begintalknode;
	tag = 6;
	condition = get_sdf(this_town,6) == 0;
	text1 = "Looking to the west, you can see a giant mound of rotting garbage. At least, that's what you thought it was. It suddenly shudders and wiggles. Clouds of greenish gas spray out of holes in its sides.";
	text2 = "It's alive, and it's spraying foul vapors into the air. It must be the source of the poisoned air that is slowly killing you.";
	code =
		sf(this_town,6,1);
		set_attitude(2043,10);
	break;

begintalknode;
	tag = 7;
	condition = get_sdf(this_town,7) == 0;
	text1 = "At the far end of this clearing, you see several Ro warriors. At first, you dare to feel a moment of hope. Then you see the jerky, mindless way they move and the careless way they swing their weapons around.";
	text2 = "Their skin has a greenish tint, and their expressions are utterly blank. Some magic here has infected them, controlling their minds completely. If you aren't careful, the same fate will affect you.";
	text3 = "They lurch toward you, clumsily raising their weapons. As you prepare for their attack, you hear something huge lumber through the undergrowth nearby. At last, you are near the heart of the infection.";
	code =
		sf(this_town,7,1);
		set_attitude(2044,10);
		set_attitude(30009,10);
	break;

begintalknode;
	tag = 8;
	condition = get_sdf(this_town,8) == 0;
	text1 = "There is a ladder in the middle of this tiny clearing. You look up and see that it enters the bottom of a treehouse. The tidy little structure is very well concealed. The foliage obscures it unless you are directly below it.";
	text2 = "You think you hear a shout and a thud, coming from overhead. It was quiet, so you had a hard time hearing it over the rustling of the trees. Then there is only quiet coming from within.";
	code =
		sf(this_town,8,1);
		if (gf(30,29) < 3)
			rs(2);
	break;

begintalknode;
	tag = 9;
	condition = get_sdf(this_town,9) == 0;
	text1 = "__";
	code =
		sf(this_town,9,1);
	break;

begintalknode;
	tag = 10;
	condition = get_sdf(this_town,10) == 0;
	text1 = "__";
	code =
		sf(this_town,10,1);
	break;

begintalknode;
	tag = 11;
	condition = get_sdf(this_town,11) == 0;
	text1 = "__";
	code =
		sf(this_town,11,1);
	break;

begintalknode;
	tag = 12;
	condition = get_sdf(this_town,12) == 0;
	text1 = "__";
	code =
		sf(this_town,12,1);
	break;

// MIXED

begintalknode;
	tag = 13;
	condition = 1;
	text1 = "Do you smell that?";
	text2 = "The warriors didn't return.";
	text3 = "They won't give us weapons.";
	text4 = "Lyazza speaks for us.";
	text5 = "The vapors are gone.";
	text6 = "We will rebuild.";
	text7 = "Thank you, Haven.";
	action = SPEECH_BUBBLE;
	code =
		cs();
		if (gf(20,11) == 0)
			as(get_ran(1,1,4));
			else as(get_ran(1,4,7));
	break;
	
begintalknode;
	tag = 14;
	condition = 1;
	text1 = "The poisonous vapors in these tunnels start to overcome you. You double over, hacking and wheezing.";

begintalknode;
	tag = 15;
	condition = 1;
	text1 = "When you deliver your final blow, the blob falls apart. It breaks up into huge moist chunks of goo and trash that falls apart.";
	text2 = "The air quality down here instantly improves. The foulness fades, but it doesn't disappear. Whatever is cursing Mistglen, you still haven't found and eliminated it.";
	code =
		if (gf(20,11) > 0)
			rs(2);
	break;

begintalknode;
	tag = 16;
	condition = 1;
	text1 = "The enormous plant thing stomps on the ground with its roots. Cracks appear in the dry earth.";
	text2 = "Some of the deadly gas in the tunnels below you seeps out. Once again, you feel sick and woozy.";
	text3 = "Nothing emerges from the cracks. You destroyed the source of the poison gas below. The mindless, malevolent plant doesn't realize that its attack is ineffective.";
	code =
		if (gf(20,13) == 0)
			rs(3);
			else rs(2);
	break;
	
begintalknode;
	tag = 17;
	condition = 1;
	text1 = "The plant horror has been destroyed. Moments later, a gentle breeze blows away the foul stink that fills the air. It does not return.";
	text2 = "You have beaten back the hostile magic of the Kranas Woods. This land has been reclaimed from its furious magic. The settlers here have won a temporary reprieve.";

begintalknode;
	tag = 18;
	condition = 1;
	text1 = "Vionelle is a vicious warrior and terrifyingly fast. Yet, she can't resist the skill of Haven forever. You manage to land a solid blow on her.";
	text2 = "She spits at the ground, furious. _I should not even be doing this! Warriors, finish this._ Before you can react, she vanishes.";
	text3 = "No spells. No magic trinkets. She is just gone, and the plans go with her.";
	code =
		set_dialogue_pic(851); //
		erase_char(2050);
	break;
	
begintalknode;
	tag = 19;
	condition = 1;
	text1 = "The book is mostly written in some sort of code. You can't make any sense of it.";
	text2 = "However, inside the back cover, someone wrote something in a great hurry: _Bottom right. Up up left left. All the way up. Down down left left left._";
	code =
		if (gf(30,29) < 3)
			rs(2);
	break;
			
begintalknode;
	tag = 20;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 21;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 22;
	condition = 1;
	text1 = "__";

//// Lyazza

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "A middle-aged woman of the Ro greets you in the entry hall of this tower. She wears the leather garb of the Kranas, but it is nice. Properly fitted. Not too dirty. Recently made by a proper craftsman.";
	text2 = "She bows and smiles. _Welcome, [P] of Haven, to our humble home. I am Lyazza, and I speak for my clan. I don't know what we did to deserve such a visitor in Mistglen in this terrible time, but I promise that we are grateful._";
	text5 = "As you speak with Lyazza, she offers you tea and snacks and shows you around her clan's tower. She doesn't take you outside, though. Understandable, considering what a mess it is.";
	action = INTRO;

begintalknode;
	state = 10;
	nextstate = 11;
	condition = 1;
	question = "_How did your clan come to Mistglen?_";
	text1 = "_It is our claim. My clan used to be in the Gentle Coast, but it did not suit us. We had to leave, so we obtained land out here in the wilds. The people here hate us, but we remain._";
	text2 = "_We will stay as long as we can. Their hate won't shake us, but the poison coming from the earth might._";
	code =
		if (gf(20,11) > 0)
			rs(2);
	break;
	
begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_People here hate the Gentle Coast?_";
	text1 = "_They see the Gentle Coast as overly settled. Weak. Decadent. I won't bother to argue with them. We know what is true._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_Why did you leave the Gentle Coast?_";
	text1 = "_It was too crowded. Too peaceful. Too controlled. Too close to the laws of your Empire. We needed to be in a place that is more wild. More free._";
	text2 = "_Perhaps we got more wildness than we expected._";

begintalknode;
	state = 11;
	nextstate = 12;
	condition = 1;
	question = "_How did you claim this land?_";
	text1 = "_It was granted to us by your governor. Governor Yvette. Mistglen was rich land, going unused. We argued with her that we could make it profitable. The folk of the Kranas wouldn't touch it._";
	text2 = "_Yvette was hesitant to agree until we gave the proper offering._";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_You paid Haven?_";
	text1 = "_That is Governor Yvette's way. If you want Haven to smile upon you, you must offer tribute to her._ She shrugs. _It is the way of things._";

begintalknode;
	state = 10;
	nextstate = 13;
	condition = 1;
	question = "_Tell me about this land._";
	text1 = "_Mistglen is a beautiful land. Everything grows well here, even though a light fog always hangs over the land. It is lovely. The fireflies glow at night. It's almost magical._";
	text2 = "_I am still surprised that the Kranas let us buy it out from under them. I guess that one of their sacred groves used to be here._";

begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_What happened to the grove?_";
	text1 = "_It died. There was magic here, and it faded. I don't know why. We ask the few Kranas who come out here, but they won't say anything._";

begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_The Kranas don't want this land?_";
	text1 = "_None of them tried to stop us from settling here. They don't approve of our being here, but they are polite enough when they talk to us._";
	text2 = "_We're Ro, though. They can't hide their Deep Truth from us. We see that they don't want us here. This is our claim, though. We will stay as long as we can._";

begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_Has the land been fruitful?_";
	text1 = "_It was, for a time. Truly, we thought we'd found a true home for our clan. Then the vapors came. Now life is a struggle._";
	
begintalknode;
	state = 10;
	nextstate = 14;
	condition = gf(20,11) == 0;
	question = "_This is a terrible time?_";
	text1 = "_You must have heard. The forest has come alive. It is angry, and it is attacking all here, Haven and Ro alike. We have not been spared. The land puts off sickly vapors. They sicken our crops and our people._";

begintalknode;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "_Sickly vapors?_";
	text1 = "_A sour gas. You must be able to smell it._ You absolutely can. _It seeps out of the earth. It makes us sick. If you go underground, it grows dangerously strong._";

begintalknode;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "_Where are these 'vapors' coming from?_";
	text1 = "She shakes her head. _We don't know. We are not experienced warriors, not like the stalkers of the Kranas. We can't fight our way into the woods to battle the curse._";

begintalknode;
	state = 14;
	nextstate = 18;
	condition = 1;
	question = "_Have you looked for help?_";
	text1 = "_We have done our best. We found a band of mercenaries and paid them in advance. They went into the woods a few days ago, and they have not returned._";
	text2 = "_This will only make it harder to hire warriors. It's a pity. These old groves often have treasure hidden in them._";

begintalknode;
	state = 18;
	nextstate = -1;
	condition = 1;
	question = "_And if I wanted that treasure?_";
	text1 = "She is surprised. _I know that Havenites are skilled hunters. If you want to test yourself in our woods, feel free. Please keep any treasure you can find._";

begintalknode;
	state = 10;
	nextstate = 15;
	condition = gf(20,11) == 1;
	question = "_I have purged Mistglen of evil influences._";
	text1 = "You tell her the tale. She is shocked. _I had no idea that such powerful magic was plaguing us. It is gone now, but it may return. We won't give up, though. We will prepare. If we want to live in the wilds, we must fight. Thank you, [P]._";
	text2 = "_Please keep any old treasures you found while exploring. I will unlock one of our storerooms upstairs. Help yourself to what you find. Oh, and what happened to the mercenaries we hired?_";
	code =
		sf(20,19,1);
		sf(20,11,2);
	break;
	
begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_Dead, I'm afraid._";
	text1 = "_A true shame. I suppose we should send something to their survivors. Excuse me. Now that we have hope, we need to get to work._";
	action = END_TALK;
	

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(30,29) == 3;
	question = "_I'm looking for a druid named Adhuil._";
	text1 = "_Hmmm. Don't recognize the name. But ..._ She thinks. _We have caught glimpses of something humanoid wandering around in the mist. Avoids us. Thought it was just a ka-wolf, but it walked upright._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(15,24) > 2;
	question = "_How are things in Mistglen?_";
	text1 = "_Beautiful and hopeful again, for the moment. We are hard at work to make sure, when the plague returns, we can burn it out ourselves._";
	
//

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 40;
	condition = 1;
	question = "Name";
	text1 = "The lone resident of this treehouse is sitting by the far wall, sipping some tea. She is a druid of the Kranas, and she looks very nervous.";
	text2 = "_I am Druid Adhuil,_ she says, holding the teacup in her trembling hand. _I am a watcher of the woods, and I don't want to talk to you._";
	text5 = "Druid Adhuil sits by the wall, looking away from you. Something is causing her great discomfort, far more than could be explained by your nation or rank.";
	action = INTRO;

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_I am a [P] of Haven._";
	text1 = "_I am aware of you. I know where you are from. You are the source of our plagues. I will be polite, but I won't help you._";

begintalknode;
	state = 40;
	nextstate = 41;
	condition = 1;
	question = "_What are you doing here?_";
	text1 = "_I am a druid, but I also work with the Erudico. I am looking for ways to heal the groves that were lost. Ways to bring them back to life. That is why I came here. I want to know if this grove can be restored._";
	text2 = "As she talks, her eyes flick wildly around the room. Something is happening here besides mere research.";
	code =
		if (gf(30,29) != 3)
			rs(2);
	break;
	
begintalknode;
	state = 41;
	nextstate = 40;
	condition = 1;
	question = "_What is hurting the groves?_";
	text1 = "_Your governor and your greed. The groves and the woods around them are full of wealth, and Haven is unable to leave them alone. You come here, but you will learn nothing._";

begintalknode;
	state = 41;
	nextstate = -1;
	condition = gf(30,29) != 3;
	question = "_Is there any way I can help?_";
	text1 = "_No. Your governor and your greed are what is killing the groves. I want you to leave. I want all of you to leave. Please let me have my peace._";
	action = END_TALK;
	
begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_Do the settlers know that you are here?_";
	text1 = "_Who? The outsiders? The soft invaders from the Gentle Coast? Yes, they know, and they lack the will to stop me._";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = 70;
	condition = gf(30,29) == 3;
	question = "_I was sent by Erud Fa'alis. I need the plans for The Harvester._";
	text1 = "For a moment, Druid Adhuil looks terrified. Just a moment. You see a tiny motion out of the corner of your eye. The druid claps her hand to her neck. Then she turns pale and starts to gasp.";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "_I'll be going now._";
	text1 = "She nods silently. You turn away. Nothing more to be gained here.";
	text2 = "";
	action = END_TALK;

begintalknode;
	state = 70;
	nextstate = 71;
	condition = 1;
	question = "_Are you all right?_";
	text1 = "She twitches and makes little gasping noises. Her hand falls away, revealing that her neck has a little dart in it.";
	text2 = "You hear someone chuckle behind you. A woman with a deep voice.";

begintalknode;
	state = 70;
	nextstate = 71;
	condition = 1;
	question = "_No, really, pay attention. This is important!_";
	text1 = "Her eyelids flicker. That is the only response you get. She twitches and makes little gasping noises. Her hand falls away, revealing that her neck has a little dart in it.";
	text2 = "You hear someone chuckle behind you. A woman with a deep voice.";

begintalknode;
	state = 71;
	nextstate = 72;
	condition = 1;
	question = "Turn to attacker. _Who are you?_";
	text1 = "You turn and find yourself facing five Rokaj warriors. They were in the room when you entered, but some strange magic kept them concealed. Their leader is a woman with a long, wicked sword in one hand and a long tube in the other. She has the calm, precise movements and cold eyes of a trained killer.";
	text2 = "_I am Vionelle of the Geld Nas,_ she says. _You are interrupting the private business of the Ro._ She lifts the flap of a satchel hanging from her belt. You see an old callum scroll inside. _Fortunately, we are done. We will go now._";
	code =
		set_dialogue_pic(851); //
		sf(20,15,1);
		set_attitude(2049,4);
		force_char_status(2049,6,40);
		set_health(2049,get_max_health(2049) / 5);
		activate_hidden_group(17);
		set_attitude(30017,10);
		set_dialogue_pic(851);
	break;
	
begintalknode;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "_Will the druid die?_";
	text1 = "_I certainly hope so. The Geld Nas don't appreciate having our time wasted._";

begintalknode;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "_I'm looking for the plans for The Harvester._";
	text1 = "_They belong to the Geld Nas now. They should be in our hands. We can use them best. They aren't for the Erudico, and they aren't for you._";
	text2 = "";

begintalknode;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "_Do you know who I am? I am [P] [N] of Haven._";
	text1 = "Vionelle looks insulted. _Of course we know who you are. We have not interfered with you in any way. We are not fools enough to interfere with the royalty of Haven. Please return the favor._";

begintalknode;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "_Who are the Geld Nas?_";
	text1 = "_We are the assassin's guild of the Rokaj. For centuries, Haven has been wise enough to leave us to our business. Please keep making the correct decision._";

begintalknode;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "_I demand that you give me that scroll._";
	text1 = "Vionelle sighs. _We have discussed what to do if this situation emerged. Please be assured that the Geld Nas had a lot of debate about it. We really carefully considered it._";
	text2 = "_Anyway, we decided that, if this happened, the best thing for us would probably be that you die._";
	action = END_TALK;

begintalknode;
	state = 72;
	nextstate = -1;
	condition = 1;
	question = "_Just go._";
	text1 = "Vionelle nods. _Our truce continues. Wisdom reigns. I suppose your druid can live. The plans are ours. [P], I strongly suggest you leave us alone._";
	text2 = "The Geld Nas use the ladder to leave the treehouse.";
	action = END_TALK;
	code =
		erase_char(30017);
	break;


//

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 100;
	condition = 1;
	question = "Name";
	text1 = "Now that the attackers are gone, you are alone with the druid.";

begintalknode;
	state = 100;
	nextstate = 101;
	condition = char_ok(2049) == FALSE;
	question = "Check on Druid Adhuil.";
	text1 = "You soon confirm that she has been mortally wounded. As she starts to slip away, she whispers something.";

begintalknode;
	state = 101;
	nextstate = -1;
	condition = 1;
	question = "Listen to her last words.";
	text1 = "_The Wyrm's Teeth. That is where ..._ The rest of it is too soft to hear. She dies.";
	text2 = "Erud Fa'alis will be very unhappy. You have learned all that you can here.";
	action = END_TALK;

begintalknode;
	state = 100;
	nextstate = 102;
	condition = char_ok(2049);
	question = "Check on Druid Adhuil.";
	text1 = "You inspect the druid and find, surprisingly, that she is still alive. She raises her hand and mutters a few words. It takes some time, but her spell manages to stabilize her.";
	text2 = "She unsteadily rises to her feet.";

begintalknode;
	state = 102;
	nextstate = -1;
	condition = 1;
	question = "_I can help you._";
	text1 = "She waves you away. _I appreciate you saving my life, but I am no friend of Haven. I will be able to return to safety on my own._";

begintalknode;
	state = 102;
	nextstate = -1;
	condition = 1;
	question = "_Who were your attackers?_";
	text1 = "_They were the Geld Nas. They want the Harvester. I'm sure Fa'alis told you. He can tell you far more than I. I had an errand, and I failed. I am done with the matter. I have to go hide now._";

begintalknode;
	state = 102;
	nextstate = -1;
	condition = 1;
	question = "_You should get to safety._";
	text1 = "She nods. _I will. Take a message to Fa'alis. Tell him to look to the Wyrm's Teeth._ She begins to pack up a satchel for her journey. She ignores all of your questions.";
	text2 = "Eventually, she manages to get herself down the ladder. You are alone.";
	action = END_TALK;
	code =
		erase_char(2049);
	break;
	
//

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 160;
	state = -1;
	nextstate = 160;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 160;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
		
//

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
				